<template>
    <div>
        <!--导航条-->
      <ul class="nav nav-tabs">
        <!--
        <router-link :to="nav.path">  路由(跳转)的地址
        -->
        <!--<li role="presentation" v-for="nav in navList"><router-link :to="nav.path"><a href="#">{{nav.name}}</a></router-link></li>-->
        <li role="presentation" v-for="nav in navList">
          <a href="#" @click="routerLinkFun(nav.path)">{{nav.name}}</a></li>

      </ul>
    </div>
</template>

<script>
    export default {
        name: "MyHeader",
        data(){
          //"path":"/phone/1"   传参
          //数据库查出来的
         return { navList:[{"name":"手机","path":"/phone/1"},
             {"name":"电脑","path":"/computer"}]}
        },
        methods:{
          routerLinkFun(path){
              this.$router.push(path);
          }
        }
    }
</script>

<style scoped>

</style>
